# 父类
class Bird:
    def intro(self):
        print("There are many types of birds.")

    def flight(self):
        print("Most of the birds can fly but some cannot.")

# 子类重写父类方法
class Sparrow(Bird):
    def flight(self):
        print("Sparrows can fly.")

class Ostrich(Bird):
    def flight(self):
        print("Ostriches cannot fly.")

# 实例化子类对象并调用方法
sparrow = Sparrow()
ostrich = Ostrich()

sparrow.intro()
sparrow.flight()

ostrich.intro()
ostrich.flight()

